1. Field of the Invention
The present invention relates generally to register management in computer systems.
2. Background Art
Register management schemes are a factor in determining the efficiency of a computer system. Registers are used for sharing data between processes, as well as to temporarily hold data retrieved from random access memory (RAM) for processing. Information held in registers may include memory addresses and data for instruction execution. Registers are implemented using various well known methods, including register files.
Several types of registers are identified in the art. General purpose registers (GPR) can be used for holding addresses as well as data. The GPR resources available to processes in a computer are limited. In general, multiple concurrent processes may have read and/or write access to a given GPR. A number of well known schemes can be implemented to ensure that values written into a GPR by one process are not corrupted by another process. For example, one may implement a locking scheme whereby the process that writes a data item to a GPR maintains a lock on that GPR for the duration of the usefulness of that data. A register that is locked by one process is, in general, inaccessible to all other processes until it is unlocked. Any resulting contention conditions between processes for register resources may slow processing in the overall system. Therefore, a computer should manage its GPR resources so as to maintain the continued availability of GPRs to processes that require register resources.
In most existing register management schemes, the available GPRs are pre-allocated among the different application threads or processes at the time of application initiation. For example, a GPR array may be allocated to an application in a computer where the GPR array is mostly used for pre-fetching data from memory and holding until that data can be loaded to the respective local registers for processing by the constituent processes of the application. Sets of registers from this GPR array may be allocated to processes based on the expected volume of data used by each process. Such an allocation to processes is necessary in order to avoid deadlock conditions or prolonged waiting conditions that may occur due to dependencies among the processes. Deadlock or prolonged waiting conditions may occur due to dependencies among two or more processes.
A deadlock, as used herein, occurs when two processes sharing the same resource are effectively preventing each other, directly or indirectly, from accessing the resource, resulting in both processes being unable to progress. Many deadlock detection methods are known in the art. An application may be analyzed to determine dependencies among various processes included in the application, to determine groups of those processes that have the potential for deadlock.
Pre-allocation of registers to workloads at application initiation time may result in an allocation that is optimized for a particular set of workload demands. However, when the workload demand differs from what the register allocation was based on, many of the registers may not be fully utilized. Such under-utilization may be due to preventing the use of a register by any other workload than the workload it was originally allocated to. In order to minimize the under-utilization of the registers, some register management schemes attempt to dynamically change the allocations of sets of registers to workloads as the workload mix changes. This generally requires that the registers are flushed, set to idle, and then updated with new allocations, before the new allocations can be activated. Having to flush registers each time a substantial change in the workload mix occurs is expensive in terms of control overhead, execution delay, and wasted register resources.
What is needed therefore is a dynamic register management scheme that efficiently manages the available register resources.